const { db, mongoose } = require("../utils/mongoose");

const positionSchema = {
    username: { type: String, require },
    password: { type: String, require },
    nickName: { type: String, require },
    power: { type: String, require },
    phone: { type: String, require },
    email: { type: String, require }
}

const UsersModel = mongoose.model("users", positionSchema);

const login = (query) => {
    return UsersModel.find(query)
        .then(result => result)
        .catch(err => {
            return false
        })
}
module.exports = {
    login
}